package com.UI
{
	import com.*;
	import com.Engine.*;
	import com.Packet.*;
	
	import flash.display.*;
	import flash.events.*;
	import flash.external.*;
	import flash.filters.*;
	import flash.geom.*;
	import flash.system.*;
	import flash.text.*;
	import flash.ui.*;
	import flash.utils.*;
	
	import org.aswing.*;
	import org.aswing.border.*;
	import org.aswing.border.EmptyBorder;
	import org.aswing.colorchooser.*;
	import org.aswing.dnd.*;
	import org.aswing.event.*;
	import org.aswing.ext.*;
	import org.aswing.geom.*;
	import org.aswing.tree.AbstractLayoutCache;
	public class FrameWChar extends JFrame
	{
		//members define
		private var panelLeft:JPanel;
		private var panel15:JPanel;
		private var btn_tab_char:JToggleButton;
		private var btn_tab_trends:JToggleButton;
		private var panelRight:JPanel;
		
		//-----------------------------------
		private var btn_close:JButton;
		private var panelRightChar:PanelWCharChar;
		private var panelRightArchive:PanelWCharTrends;
		private var background:String;
		
		public function FrameWChar()
		{
			//component creation
			super();
			_frame = this;
			setResizable(false);
			setBackgroundDecorator(null);
			setBorder(new EmptyBorder());
			btn_close = new JButton();
			btn_close.setLocation(new IntPoint(198, 0));
			btn_close.setSize(new IntDimension(27, 27));
			btn_close.setPreferredSize(new IntDimension(27, 27));
			getTitleBar().setCloseButton(btn_close);
			getTitleBar().setMinimizeHeight(32);
			
			//component creation
			setSize(new IntDimension(278, 399));
			setPreferredSize(new IntDimension(278, 399));
			var layout0:SoftBoxLayout = new SoftBoxLayout();
			layout0.setAxis(AsWingConstants.VERTICAL);
			layout0.setAlign(AsWingConstants.LEFT);
			layout0.setGap(0);
			getContentPane().setLayout(layout0);
			
			panelLeft = new JPanel();
			panelLeft.setLocation(new IntPoint(0, 0));
			panelLeft.setSize(new IntDimension(299, 33));
			panelLeft.setPreferredSize(new IntDimension(278, 33));
			var layout1:FlowWrapLayout = new FlowWrapLayout();
			layout1.setPreferWidth(200);
			layout1.setAlignment(AsWingConstants.LEFT);
			layout1.setHgap(20);
			layout1.setVgap(4);
			panelLeft.setLayout(layout1);
			
			panel15 = new JPanel();
			panel15.setLocation(new IntPoint(0, 3));
			panel15.setSize(new IntDimension(180, 25));
			panel15.setPreferredSize(new IntDimension(180, 25));
			var layout2:SoftBoxLayout = new SoftBoxLayout();
			layout2.setAxis(AsWingConstants.HORIZONTAL);
			layout2.setAlign(AsWingConstants.LEFT);
			layout2.setGap(3);
			panel15.setLayout(layout2);
			
			btn_tab_char = new JToggleButton();
			btn_tab_char.setLocation(new IntPoint(0, 5));
			btn_tab_char.setSize(new IntDimension(58, 25));
			btn_tab_char.setPreferredSize(new IntDimension(58, 25));
			btn_tab_char.setText("label");
			
			btn_tab_trends = new JToggleButton();
			btn_tab_trends.setLocation(new IntPoint(5, 32));
			btn_tab_trends.setSize(new IntDimension(58, 25));
			btn_tab_trends.setPreferredSize(new IntDimension(58, 25));
			btn_tab_trends.setText("label");
			
			panelRight = new JPanel();
			panelRight.setLocation(new IntPoint(5, 379));
			panelRight.setSize(new IntDimension(299, 359));
			panelRight.setPreferredSize(new IntDimension(278, 359));
			
			//component layoution
			//append(panelLeft);
			//append(panelRight);
			
			panelLeft.append(panel15);
			
			panel15.append(btn_tab_char);
			panel15.append(btn_tab_trends);
			
			
			
			panelRightChar = new PanelWCharChar();
			panelRightChar.setLocation(new IntPoint(36, 0));
			panelRightChar.setSize(new IntDimension(278, 359));
			panelRightChar.setPreferredSize(new IntDimension(278, 359));
			
			panelRightArchive = new PanelWCharTrends();
			panelRightArchive.setLocation(new IntPoint(36, 0));
			panelRightArchive.setSize(new IntDimension(278, 359));
			panelRightArchive.setPreferredSize(new IntDimension(278, 359));
			
			//component layoution
			getContentPane().append(panelLeft);
			getContentPane().append(panelRightChar);
			panelRight = panelRightChar;
			
			setImages();
			this.setClipMasked(false);
			this.getContentPane().setClipMasked(false);
		}

		private function setImages():void
		{
			background = "img_wfriend_bg";
			var img_char_background:DisplayObject = Client.getUIElement("img_wfriend_bg") as DisplayObject
			setBackgroundDecorator(new AssetBackground(img_char_background));
			setSizeWH(img_char_background.width,img_char_background.height);
			setLocationXY((Engine.W - img_char_background.width)/2,(Engine.H - img_char_background.height)/2);
			btn_tab_char.setSelected(true);
			
			btn_tab_char.addActionListener(onTabFriend);
			btn_tab_trends.addActionListener(onTabArchive);
			
			btn_tab_char.wrapSimpleButton(Client.getUIElement("btn_tab_char") as SimpleButton);
			btn_tab_trends.wrapSimpleButton(Client.getUIElement("btn_tab_trends") as SimpleButton);
			var group:ButtonGroup = new ButtonGroup();
			group.appendAll(btn_tab_char,btn_tab_trends);
			
			btn_close.wrapSimpleButton(Client.getUIElement("btn_close") as SimpleButton);
		}
		static public function phFriendWatch_605(e:PacketEvent):void
		{
			var msg:Array = e.data as Array;
			trace("phFriendWatch_605", msg);
			var nIndex:uint = 0;
			_objWatch.m_nCharId = msg[nIndex++];
			_objWatch.m_szCharName = msg[nIndex++];
			_objWatch.m_nLevel = msg[nIndex++];
			_objWatch.m_nRace = msg[nIndex++];
			_objWatch.m_nGender = msg[nIndex++];
			_objWatch.m_nValue = msg[nIndex++];
			_objWatch.m_stTitleCurrent = [];
			_objWatch.m_stTitleCurrent.csv_id = msg[nIndex++];
			_objWatch.m_stTitleCurrent.name = msg[nIndex++];
			_objWatch.m_szFactionName = msg[nIndex++];
			
			_objWatch.m_nHP = msg[nIndex++];
			_objWatch.m_nAP = msg[nIndex++];
			_objWatch.m_nDP = msg[nIndex++];
			_objWatch.m_nSP = msg[nIndex++];
			
			_objWatch.m_nResistHL = msg[nIndex++];
			_objWatch.m_nResistBD = msg[nIndex++];
			_objWatch.m_nResistHS = msg[nIndex++];
			
			_objWatch.m_nPropBJ = msg[nIndex++];
			_objWatch.m_nPropSB = msg[nIndex++];
			_objWatch.m_nPropFJ = msg[nIndex++];
			_objWatch.m_nPropLJ = msg[nIndex++];
			
			if(_objWatch.m_arEquips == null)
				_objWatch.m_arEquips = [];
			var array:Array = _objWatch.m_arEquips;
			array.splice(0,array.length);
			var nCount:uint = msg[nIndex++];
			for(var i:int = 0; i < nCount; i++)
			{
				var obj:Object = new Object();
				array[i] = obj;
				obj.csv_id = msg[nIndex++];
				if(obj.csv_id == 0)
				{
					continue;
				}
				obj.count = msg[nIndex++];
				obj.equip_level = msg[nIndex++];
				obj.equip_hp = msg[nIndex++];
				obj.equip_ap = msg[nIndex++];
				obj.equip_dp = msg[nIndex++];
				obj.equip_sp = msg[nIndex++];
				
				obj.equip_enhanceHL = msg[nIndex++];
				obj.equip_enhanceBD = msg[nIndex++];
				obj.equip_enhanceHS = msg[nIndex++];
				
				obj.equip_resistHL = msg[nIndex++];
				obj.equip_resistBD = msg[nIndex++];
				obj.equip_resistHS = msg[nIndex++];
				
				obj.equip_prop_BJ = msg[nIndex++];
				obj.equip_prop_SB = msg[nIndex++];
				obj.equip_prop_FJ = msg[nIndex++];
				obj.equip_prop_LJ = msg[nIndex++];
				
				obj.creator_char_gender = msg[nIndex++];
				obj.creator_char_name = msg[nIndex++];
				obj.creator_lover_gender = msg[nIndex++];
				obj.creator_lover_name = msg[nIndex++];
				
			}
			
			if(_objWatch._trends == null)
				_objWatch._trends = [];
			_objWatch._trends.splice(0,_objWatch._trends.length);
			
			for(var k:int = 0; k < Const.TREND_TYPE_SIZE; k++)
			{
				nCount = msg[nIndex++];
				for(i = 0; i < nCount; i++)
				{
					var objTrends:Object = new Object;
					objTrends.m_tTime = msg[nIndex++];
					objTrends.m_szMessage = msg[nIndex++];
					_objWatch._trends.push(objTrends);
				}
			}
			_objWatch._trends.sortOn("m_tTime",Array.NUMERIC);
			show();
		}
		private function onTabFriend(e:Event):void
		{
			if(background != "img_wfriend_bg")
			{
				background = "img_wfriend_bg";
				var img_char_background:DisplayObject = Client.getUIElement("img_wfriend_bg") as DisplayObject
				setBackgroundDecorator(null);
				setBackgroundDecorator(new AssetBackground(img_char_background));
			}
			if(panelRight != panelRightChar)
			{
				getContentPane().remove(panelRight);
				panelRight = panelRightChar;
				getContentPane().append(panelRight);
				panelRightChar.setData();
			}
			paintImmediately();
		}
		private function onTabArchive(e:Event):void
		{
			if(background != "img_wfriend_trends_bg")
			{
				background = "img_wfriend_trends_bg";
				var img_background:DisplayObject = Client.getUIElement("img_wfriend_trends_bg") as DisplayObject;
				setBackgroundDecorator(null);
				setBackgroundDecorator(new AssetBackground(img_background));
			}
			
			if(panelRight != panelRightArchive)
			{
				getContentPane().remove(panelRight);
				panelRight = panelRightArchive;
				getContentPane().append(panelRight);
				panelRightArchive.setData();
			}
			paintImmediately();
		}
		
		public static var _frame:FrameWChar = null;
		public static var _objWatch:Object = [];
		public static function show():void
		{
			//_objWatch = obj;
			//if(FrameWChar._objWatch.online == 1)
			//	Client.getInstance().sendPacketLogic(605,[int(FrameWChar._objWatch.m_nCharId)]);
			
			if(_frame == null)
			{
				_frame = new FrameWChar();
				PanelMainHelp.getInstance().addChild(_frame);
			}

			_frame.show();
			PanelMainHelp.getInstance().bringToTop(_frame);
			/*if(FrameWChar._objWatch.online == 0)
			{
				if(_frame.panelRight != _frame.panelRightChar)
				{
					_frame.onTabFriend(null);
					_frame.btn_tab_char.setSelected(true);
					_frame.btn_tab_trends.setSelected(false);
				}
				_frame.btn_tab_trends.setEnabled(false);
			}
			else
			{
				_frame.btn_tab_trends.setEnabled(true);
			}*/
			
			//_frame.labelLevel.setText(FrameFriendWatch._objWatch.m_nLevel.toString());
			if(_frame.panelRight != _frame.panelRightChar)
			{
				_frame.onTabFriend(null);
				_frame.btn_tab_char.setSelected(true);
				_frame.btn_tab_trends.setSelected(false);
			}
			if(_frame.panelRight == _frame.panelRightChar)
			{
				_frame.panelRightChar.setData();
			}
			if(_frame.panelRight == _frame.panelRightArchive)
			{
				_frame.panelRightArchive.setData();
			}
			
		}
		public static function hide():void
		{
			if(isShowing())_frame.hide();
		}
		public static function isShowing():Boolean
		{
			return(_frame != null&& _frame.isShowing());
		}
	}
}
import com.*;
import com.Engine.*;
import com.Packet.*;
import com.UI.*;

import flash.display.*;
import flash.events.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.net.*;
import flash.system.*;
import flash.text.*;
import flash.ui.*;
import flash.utils.*;

import gs.*;
import gs.easing.*;
import gs.events.TweenEvent;

import org.aswing.*;
import org.aswing.border.*;
import org.aswing.border.EmptyBorder;
import org.aswing.colorchooser.*;
import org.aswing.dnd.*;
import org.aswing.event.*;
import org.aswing.ext.*;
import org.aswing.geom.*;
import org.aswing.plaf.*;
import org.aswing.skinbuilder.SkinProgressBarBackground;
import org.aswing.skinbuilder.SkinProgressBarForeground;

	/**
	 * PanelRightChar
	 */
	class PanelWCharChar extends JPanel{
		
		//members define
		private var panelHead:JPanel;
		private var labelName:JLabelButton;
		private var labelValue:JLabel;
		private var labelLevel:JLabel;
		private var labelTitle:JLabel;
		private var labelFaction:JLabel;
		private var labelHP:JLabel;
		private var labelAP:JLabel;
		private var labelDP:JLabel;
		private var labelSP:JLabel;
		private var labelResistHL:JLabel;
		private var labelResistBD:JLabel;
		private var labelResistHS:JLabel;
		private var labelPropBJ:JLabel;
		private var labelPropSB:JLabel;
		private var labelPropFJ:JLabel;
		private var labelPropLJ:JLabel;
		private var panelEquips:JPanel;
		private var btn_equip_hat:PanelItem;
		private var btn_equip_cloth:PanelItem;
		private var btn_equip_belt:PanelItem;
		private var btn_equip_weapon:PanelItem;
		private var btn_equip_pants:PanelItem;
		private var btn_equip_shoe:PanelItem;
		/**
		 * PanelRightChar Constructor
		 */
		public function PanelWCharChar(){
			
			//component creation
			setSize(new IntDimension(278, 359));
			setPreferredSize(new IntDimension(278, 359));
			var layout0:EmptyLayout = new EmptyLayout();
			setLayout(layout0);
			
			panelHead = new JPanel();
			panelHead.setLocation(new IntPoint(36, 56));
			panelHead.setSize(new IntDimension(69, 69));
			panelHead.setPreferredSize(new IntDimension(69, 69));
			panelHead.setBorder(null);
			
			labelName = new JLabelButton();
			labelName.setLocation(new IntPoint(26, 14));
			labelName.setSize(new IntDimension(89, 16));
			labelName.setPreferredSize(new IntDimension(89, 16));
			labelName.setText("陶陶陶");
			labelName.setHorizontalAlignment(AsWingConstants.CENTER);
			
			labelValue = new JLabel();
			labelValue.setLocation(new IntPoint(26, 37));
			labelValue.setSize(new IntDimension(89, 16));
			labelValue.setPreferredSize(new IntDimension(89, 16));
			labelValue.setText("label");
			
			labelLevel = new JLabel();
			labelLevel.setLocation(new IntPoint(161, 14));
			labelLevel.setSize(new IntDimension(89, 16));
			labelLevel.setPreferredSize(new IntDimension(89, 16));
			labelLevel.setText("label");
			
			labelTitle = new JLabel();
			labelTitle.setLocation(new IntPoint(161, 37));
			labelTitle.setSize(new IntDimension(89, 16));
			labelTitle.setPreferredSize(new IntDimension(89, 16));
			labelTitle.setText("10000");
			labelTitle.setHorizontalAlignment(AsWingConstants.CENTER);
			
			labelFaction = new JLabel();
			labelFaction.setLocation(new IntPoint(161, 60));
			labelFaction.setSize(new IntDimension(89, 16));
			labelFaction.setPreferredSize(new IntDimension(89, 16));
			labelFaction.setText("label");
			
			labelHP = new JLabel();
			labelHP.setLocation(new IntPoint(161, 97));
			labelHP.setSize(new IntDimension(89, 16));
			labelHP.setPreferredSize(new IntDimension(89, 16));
			labelHP.setText("256");
			labelHP.setHorizontalAlignment(AsWingConstants.CENTER);
			
			labelAP = new JLabel();
			labelAP.setLocation(new IntPoint(161, 120));
			labelAP.setSize(new IntDimension(89, 16));
			labelAP.setPreferredSize(new IntDimension(89, 16));
			labelAP.setText("369");
			labelAP.setHorizontalAlignment(AsWingConstants.CENTER);
			
			labelDP = new JLabel();
			labelDP.setLocation(new IntPoint(161, 143));
			labelDP.setSize(new IntDimension(89, 16));
			labelDP.setPreferredSize(new IntDimension(89, 16));
			labelDP.setText("label");
			
			labelSP = new JLabel();
			labelSP.setLocation(new IntPoint(161, 166));
			labelSP.setSize(new IntDimension(89, 16));
			labelSP.setPreferredSize(new IntDimension(89, 16));
			labelSP.setText("1456");
			labelSP.setHorizontalAlignment(AsWingConstants.CENTER);
			
			labelResistHL = new JLabel();
			labelResistHL.setLocation(new IntPoint(173, 202));
			labelResistHL.setSize(new IntDimension(89, 16));
			labelResistHL.setPreferredSize(new IntDimension(89, 16));
			labelResistHL.setText("123");
			labelResistHL.setHorizontalAlignment(AsWingConstants.CENTER);
			
			labelResistBD = new JLabel();
			labelResistBD.setLocation(new IntPoint(173, 225));
			labelResistBD.setSize(new IntDimension(89, 16));
			labelResistBD.setPreferredSize(new IntDimension(89, 16));
			labelResistBD.setText("123");
			labelResistBD.setHorizontalAlignment(AsWingConstants.CENTER);
			
			labelResistHS = new JLabel();
			labelResistHS.setLocation(new IntPoint(173, 248));
			labelResistHS.setSize(new IntDimension(89, 16));
			labelResistHS.setPreferredSize(new IntDimension(89, 16));
			labelResistHS.setText("123");
			labelResistHS.setHorizontalAlignment(AsWingConstants.CENTER);
			
			labelPropBJ = new JLabel();
			labelPropBJ.setLocation(new IntPoint(55, 295));
			labelPropBJ.setSize(new IntDimension(76, 16));
			labelPropBJ.setPreferredSize(new IntDimension(76, 16));
			labelPropBJ.setText("label");
			
			labelPropSB = new JLabel();
			labelPropSB.setLocation(new IntPoint(176, 295));
			labelPropSB.setSize(new IntDimension(86, 16));
			labelPropSB.setPreferredSize(new IntDimension(86, 16));
			labelPropSB.setText("label");
			
			labelPropFJ = new JLabel();
			labelPropFJ.setLocation(new IntPoint(55, 318));
			labelPropFJ.setSize(new IntDimension(76, 16));
			labelPropFJ.setPreferredSize(new IntDimension(76, 16));
			labelPropFJ.setText("label");
			
			labelPropLJ = new JLabel();
			labelPropLJ.setLocation(new IntPoint(176, 318));
			labelPropLJ.setSize(new IntDimension(86, 16));
			labelPropLJ.setPreferredSize(new IntDimension(86, 16));
			labelPropLJ.setText("label");
			
			panelEquips = new JPanel();
			panelEquips.setLocation(new IntPoint(17, 129));
			panelEquips.setSize(new IntDimension(106, 146));
			panelEquips.setPreferredSize(new IntDimension(106, 146));
			var layout1:EmptyLayout = new EmptyLayout();
			panelEquips.setLayout(layout1);
			
			btn_equip_hat = new PanelItem();
			btn_equip_hat.setLocation(new IntPoint(3, 3));
			btn_equip_hat.setSize(new IntDimension(45, 45));
			btn_equip_hat.setPreferredSize(new IntDimension(45, 45));
			
			btn_equip_cloth = new PanelItem();
			btn_equip_cloth.setLocation(new IntPoint(59, 3));
			btn_equip_cloth.setSize(new IntDimension(45, 45));
			btn_equip_cloth.setPreferredSize(new IntDimension(45, 45));
			
			btn_equip_belt = new PanelItem();
			btn_equip_belt.setLocation(new IntPoint(3, 51));
			btn_equip_belt.setSize(new IntDimension(45, 45));
			btn_equip_belt.setPreferredSize(new IntDimension(45, 45));
			
			btn_equip_weapon = new PanelItem();
			btn_equip_weapon.setLocation(new IntPoint(59, 51));
			btn_equip_weapon.setSize(new IntDimension(45, 45));
			btn_equip_weapon.setPreferredSize(new IntDimension(45, 45));
			
			btn_equip_pants = new PanelItem();
			btn_equip_pants.setLocation(new IntPoint(3, 99));
			btn_equip_pants.setSize(new IntDimension(45, 45));
			btn_equip_pants.setPreferredSize(new IntDimension(45, 45));
			
			btn_equip_shoe = new PanelItem();
			btn_equip_shoe.setLocation(new IntPoint(59, 99));
			btn_equip_shoe.setSize(new IntDimension(45, 45));
			btn_equip_shoe.setPreferredSize(new IntDimension(45, 45));
			
			//component layoution
			append(panelHead);
			append(labelName);
			append(labelValue);
			append(labelLevel);
			append(labelTitle);
			append(labelFaction);
			append(labelHP);
			append(labelAP);
			append(labelDP);
			append(labelSP);
			append(labelResistHL);
			append(labelResistBD);
			append(labelResistHS);
			append(labelPropBJ);
			append(labelPropSB);
			append(labelPropFJ);
			append(labelPropLJ);
			append(panelEquips);
			
			panelEquips.append(btn_equip_hat);
			panelEquips.append(btn_equip_cloth);
			panelEquips.append(btn_equip_belt);
			panelEquips.append(btn_equip_weapon);
			panelEquips.append(btn_equip_pants);
			panelEquips.append(btn_equip_shoe);
			
			_mallItems.push(btn_equip_hat);
			_mallItems.push(btn_equip_cloth);
			_mallItems.push(btn_equip_belt);
			_mallItems.push(btn_equip_weapon);
			_mallItems.push(btn_equip_pants);
			_mallItems.push(btn_equip_shoe);
			for each(var item:PanelItem in _mallItems)
			{
				item.showBackground = false;
				item.enableClick = false;
				item.addEventListener(MouseEvent.ROLL_OVER, onRollOver);
				item.addEventListener(MouseEvent.ROLL_OUT, onRollOut);
			}
			setImages();
			setData();
			
		}
		private function onRollOver(event:MouseEvent):void
		{
			var target:PanelItem = event.target as PanelItem;
			if(!(target.getBorder() is EmptyBorder))
				return;
			target.setBorder(new LineBorder(null,ASColor.YELLOW));
		}
		
		private function onRollOut(event:MouseEvent):void
		{
			var target:PanelItem = event.target as PanelItem;
			target.setBorder(new EmptyBorder());
		}
		private var _mallItems:Array = new Array();
		public function setImages():void
		{
			
			//panelHead.setBackgroundDecorator(new AssetBackground(Client.getUIElement("img_char_head_girl") as DisplayObject));
			//btnTeam.wrapSimpleButton(Client.getUIElement("btn_wfriend_team") as SimpleButton);
			//btnTrade.wrapSimpleButton(Client.getUIElement("btn_wfriend_trade") as SimpleButton);
			panelHead.setBackgroundDecorator(new AssetBackground(Client.getUIElement("img_head") as DisplayObject));
			var filter:GlowFilter;
			var font:ASFont = new ASFont("宋体", 12, false, false, false, false);
			filter = new GlowFilter(0x000000, 1, 2, 2, 10);
			labelName.setFont(new ASFont("宋体", 13, false, false, true, false));
			labelName.setForeground(ASColor.WHITE);
			labelName.setTextFilters(new Array(filter));
			labelValue.setFont(new ASFont("宋体", 13, true, false, false, false));
			labelValue.setForeground(ASColor.YELLOW);
			labelValue.setTextFilters(new Array(filter));
			labelLevel.setFont(font);
			labelLevel.setForeground(ASColor.WHITE);
			labelLevel.setTextFilters(new Array(filter));
			labelTitle.setFont(font);
			labelTitle.setForeground(ASColor.WHITE);
			labelTitle.setTextFilters(new Array(filter));
			
			//labelName.setHorizontalTextPosition(AsWingConstants.CENTER);
			//labelName.setVerticalTextPosition(AsWingConstants.CENTER);
			
			labelFaction.setFont(font);
			labelFaction.setForeground(ASColor.WHITE);
			labelFaction.setTextFilters(new Array(filter));
			
			labelHP.setFont(font);
			labelHP.setForeground(ASColor.WHITE);
			labelHP.setTextFilters(new Array(filter));
			labelAP.setFont(font);
			labelAP.setForeground(ASColor.WHITE);
			labelAP.setTextFilters(new Array(filter));
			labelDP.setFont(font);
			labelDP.setForeground(ASColor.WHITE);
			labelDP.setTextFilters(new Array(filter));
			labelSP.setFont(font);
			labelSP.setForeground(ASColor.WHITE);
			labelSP.setTextFilters(new Array(filter));
			
			labelResistHL.setFont(font);
			labelResistHL.setForeground(ASColor.WHITE);
			labelResistHL.setTextFilters(new Array(filter));
			labelResistBD.setFont(font);
			labelResistBD.setForeground(ASColor.WHITE);
			labelResistBD.setTextFilters(new Array(filter));
			labelResistHS.setFont(font);
			labelResistHS.setForeground(ASColor.WHITE);
			labelResistHS.setTextFilters(new Array(filter));
			
			labelPropBJ.setFont(font);
			labelPropBJ.setForeground(ASColor.WHITE);
			labelPropBJ.setTextFilters(new Array(filter));
			labelPropSB.setFont(font);
			labelPropSB.setForeground(ASColor.WHITE);
			labelPropSB.setTextFilters(new Array(filter));
			labelPropFJ.setFont(font);
			labelPropFJ.setForeground(ASColor.WHITE);
			labelPropFJ.setTextFilters(new Array(filter));
			labelPropLJ.setFont(font);
			labelPropLJ.setForeground(ASColor.WHITE);
			labelPropLJ.setTextFilters(new Array(filter));
			
			labelName.addActionListener(onBtnName);

		}
		private function onBtnName(e:Event):void
		{
			if(FrameWChar._objWatch == null)
			{
				return;
			}
			var obj:Object = new Object;
			obj.m_nCharId = int(FrameWChar._objWatch.m_nCharId);
			obj.m_szCharName = FrameWChar._objWatch.m_szCharName;
			obj.m_nLevel = int(FrameWChar._objWatch.m_nLevel);
			obj.m_nRace = int(FrameWChar._objWatch.m_nRace);
			obj.m_nGender = int(FrameWChar._objWatch.m_nGender);
			
			var point:IntPoint = AsWingUtils.getStageMousePosition();
			FrameClickChar._objDest = obj;
			FrameClickChar._destCharId = int(obj.m_nCharId);
			FrameClickChar.show(FrameWChar._frame,point.x-FrameWChar._frame.x,point.y-FrameWChar._frame.y);
		}
		//private var textTrends:String  = new String();
		public function setData():void
		{
			labelName.setForeground(new ASColor(FrameWChar._objWatch.m_nGender == 0?Engine.colorBoy:Engine.colorGirl));
			labelName.setText(FrameWChar._objWatch.m_szCharName.toString());
			labelValue.setText('身价:' + FrameWChar._objWatch.m_nValue.toString());
			labelLevel.setText(FrameWChar._objWatch.m_nLevel.toString());
			labelTitle.setText(FrameWChar._objWatch.m_stTitleCurrent.name.toString());
			labelFaction.setText(FrameWChar._objWatch.m_szFactionName);
			
			labelHP.setText(FrameWChar._objWatch.m_nHP);
			labelAP.setText(FrameWChar._objWatch.m_nAP);
			labelDP.setText(FrameWChar._objWatch.m_nDP);
			labelSP.setText(FrameWChar._objWatch.m_nSP);
			
			labelResistHL.setText(FrameWChar._objWatch.m_nResistHL);
			labelResistBD.setText(FrameWChar._objWatch.m_nResistBD);
			labelResistHS.setText(FrameWChar._objWatch.m_nResistHS);
			
			labelPropBJ.setText(FrameWChar._objWatch.m_nPropBJ);
			labelPropSB.setText(FrameWChar._objWatch.m_nPropSB);
			labelPropFJ.setText(FrameWChar._objWatch.m_nPropFJ);
			labelPropLJ.setText(FrameWChar._objWatch.m_nPropLJ);
			
			var nIndex:int = 0;
			//var nCount:int = 0;
			for each(var item:Object in FrameWChar._objWatch.m_arEquips)
			{
				//nCount++;
				_mallItems[nIndex++].item = item;
				if(nIndex >= 6)
					break;
			}

		}
		/*private var _loader:Loader;
		private var _mcHead:MovieClip = null;
		private function onLoaded(e:Event):void
		{
			if(_mcHead != null)
			{
				if(panelHead.contains(_mcHead))
					panelHead.removeChild(_mcHead);
				_mcHead = null;
			}
			var l:LoaderInfo=e.target as LoaderInfo;
			var loader:Loader = l.loader;
			l.removeEventListener(Event.COMPLETE,onLoaded);
			l.removeEventListener(IOErrorEvent.IO_ERROR,onLoadedError);
			if(_loader != null)
			{
				var _appDomain:ApplicationDomain = _loader.contentLoaderInfo.applicationDomain;
				_mcHead = Engine.getElement(_appDomain,"mc_object_stand") as MovieClip;//e.target.content as MovieClip;//
				if(_mcHead == null)
					return;
				_mcHead.gotoAndStop(1);
				_mcHead.scaleX = panelHead.height/_mcHead.height;
				_mcHead.scaleY = panelHead.height/_mcHead.height;
				var imgSelf:JPanel = panelHead;
				_mcHead.x = (imgSelf.width - _mcHead.width)/2;//+mcTmp.width/2;
				//mcTmp.y = 0;//mcTmp.height;
				if(FrameWChar._objWatch.m_nGender == 0)
					_mcHead.y = Client._headOffsetYBoy*_mcHead.scaleY/2;//mc.height;
				else
					_mcHead.y = Client._headOffsetYGirl*_mcHead.scaleY/2;
				imgSelf.setBackgroundDecorator(null);
				imgSelf.addChild(_mcHead);
				_loader.unloadAndStop(false);
				_loader = null;
			}
			else
			{
				loader.unloadAndStop(false);
				loader = null;
			}
			
			
		}
		
		private function onLoadedError(e:IOErrorEvent):void
		{
			try
			{
				var l:LoaderInfo=e.target as LoaderInfo;
				var loader:Loader = l.loader;
				l.removeEventListener(Event.COMPLETE,onLoaded);
				l.removeEventListener(IOErrorEvent.IO_ERROR,onLoadedError);
				if(_loader != null)
				{
					_loader.unloadAndStop(false);
					_loader = null;
				}
				else
				{
					loader.unloadAndStop(false);
					loader = null;
				}
			}
			catch(e:Error)
			{
				trace("onLoadedError")
			}
		}
		public function clear():void
		{
			setBackgroundDecorator(null);
		}*/
	}
	/**
	 * PanelRightArchive
	 */
	class PanelWCharTrends extends JPanel{
		
		//members define
		private var scrollpane:JScrollPane;
		private var txtTrends:JTextArea;
		
		/**
		 * PanelRightArchive Constructor
		 */
		public function PanelWCharTrends(){
			
			//component creation
			setLocation(new IntPoint(0, 0));
			setSize(new IntDimension(278, 359));
			setPreferredSize(new IntDimension(278, 359));
			var layout0:EmptyLayout = new EmptyLayout();
			setLayout(layout0);
			
			scrollpane = new JScrollPane();
			scrollpane.setLocation(new IntPoint(12, 4));
			scrollpane.setSize(new IntDimension(256, 347));
			scrollpane.setPreferredSize(new IntDimension(256, 347));
			
			txtTrends = new JTextArea();
			txtTrends.setLocation(new IntPoint(12, 6));
			txtTrends.setSize(new IntDimension(256, 345));
			txtTrends.setPreferredSize(new IntDimension(256, 345));
			
			//component layoution
			append(scrollpane);
			
			scrollpane.append(txtTrends);
			
			this.setClipMasked(false);
			setImages();
			setData();
		}
		
		public function setImages():void
		{
			var filter:GlowFilter;
			var font:ASFont = new ASFont("宋体", 12, false, false, false, false);
			filter = new GlowFilter(0x000000, 1, 2, 2, 2);
			
			scrollpane.getVerticalScrollBar().setVisible(true);
			scrollpane.setVerticalScrollBarPolicy(JScrollPane.SCROLLBAR_ALWAYS);
			scrollpane.setHorizontalScrollBarPolicy(JScrollPane.SCROLLBAR_NEVER);
			scrollpane.getVerticalScrollBar().setUIElement(true);
			scrollpane.getVerticalScrollBar().setUI(new MyScrollBarUI);
			
			txtTrends.setBackgroundDecorator(null);
			txtTrends.setForeground(ASColor.WHITE);
			txtTrends.setWordWrap(true);
			txtTrends.setEditable(false);
			txtTrends.setFont(font);
			txtTrends.filters = new Array(filter);
			txtTrends.addEventListener(TextEvent.LINK, linkHandler);
		}
		
		private function linkHandler(linkEvent:TextEvent):void 
		{
			//trace("linkEvent.target:"+linkEvent.target+",linkEvent.currentTarget:"+linkEvent.currentTarget);
			var dtemp:Array = (linkEvent.text as String).split(',');
			if(dtemp.length != 5)
			{
				return;
			}
			
			var obj:Object = new Object;
			obj.m_nCharId = int(dtemp[0]);
			obj.m_szCharName = dtemp[1];
			obj.m_nLevel = int(dtemp[2]);
			obj.m_nRace = int(dtemp[3]);
			obj.m_nGender = int(dtemp[4]);
			
			//trace(linkEvent.text);
			//FrameInfo.showMessageDialog("","这是一个物品"+linkEvent.text);
			var point:IntPoint = AsWingUtils.getStageMousePosition();
			FrameClickChar._objDest = obj;
			FrameClickChar._destCharId = int(obj.m_nCharId);
			FrameClickChar.show(FrameWChar._frame,point.x-FrameWChar._frame.x,point.y-FrameWChar._frame.y);
			//FrameClickChar.show(0,0);
			//trace("point.x:"+point.x+" point.y:"+point.y);
		}
		
		public function clear():void
		{
			setBackgroundDecorator(null);
		}
		private var _loader:Loader = null;
		public function setData():void
		{
			var strTrends:String = "";
			for each(var item:Object in FrameWChar._objWatch._trends)
			{
				strTrends += item.m_szMessage +"<br>";
				strTrends += '<font color="#444444">----------------------------------------------------------</font><br>';
			}
			txtTrends.setHtmlText(strTrends);
			txtTrends.scrollToBottomLeft();
		}
	}